import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  UpdateDateColumn,
} from 'typeorm';

@Entity()
export class Folder {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column({ default: '未命名文件夹' })
  folder_name: string;

  @Column()
  creator: string;

  // @Column({ default: 0 })
  // files_count: number;

  @Column({ default: '-1' })
  folder_id: string;

  @Column('enum', { enum: ['person', 'group'], default: 'person' })
  role: string;

  @Column({
    type: 'timestamp without time zone',
    default: () => 'CURRENT_TIMESTAMP',
  })
  create_time: Date;

  @UpdateDateColumn({
    name: 'update_time',
    type: 'timestamp',
    default: () => 'CURRENT_TIMESTAMP',
  })
  update_time: Date;
}
